# Maintainer: @naveen521kk on Github, Naveen M K <naveen@syrusdark.website>

_perlname=IO-String
_realname="${_perlname,,}"
pkgbase=mingw-w64-perl-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-perl-${_realname}")
pkgver=1.08
pkgrel=2
pkgdesc="Emulate file interface for in-core strings (mingw-w64)"
arch=('any')
url="https://metacpan.org/release/${_perlname}"
groups=("${MINGW_PACKAGE_PREFIX}-perl-modules")
depends=(
  "${MINGW_PACKAGE_PREFIX}-perl"
)
options=('!emptydirs')
makedepends=("${MINGW_PACKAGE_PREFIX}-python")
license=(unknown)
source=(
  "https://cpan.metacpan.org/authors/id/G/GA/GAAS/${_perlname}-${pkgver}.tar.gz"
  "patchmakefile.py"
)
sha512sums=('0aae1711a2bad2a239d90ca7ceb685938e509dbefb05d6c6717796a04ce1956006f67a7a203eaa9d9718b77b5cea9b7d493091b88d9542068f0829aae3a37376'
            'd7ec5ba4a3d75f674f4028e8a53bc4177ab71a379bc63affebf910e1d5a0e491b6642318218b55ddc4d90e0125d61e4b97626782af57d44522bcb5543fb21cb2')

build() {
  cd "$srcdir/${_perlname}-${pkgver}"
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL
  export pkgdir=$pkgdir
  python $srcdir/patchmakefile.py
  mingw32-make
}

package() {
  cd "$srcdir/${_perlname}-${pkgver}"
  mingw32-make DESTDIR="${pkgdir}/" install
}
